<!--历史记录-->
<template>
	<view class="hdtybox" :class="hdc">
		<topboxVue :tit="$t('hd.bt9')"></topboxVue>
		<view class="volbox">
			<image src="/static/hd/vb.png" class="volbox-tp" mode=""></image>
			<view class="volbox-ib">
				<view class="volbox-ib-b1 bj_between mb20">
					<view class="volbox-ib-b1-item bj_sx">
						<view class="f40 fwb cy mb10">
							{{$t("menu.$")}}{{data.yeaterday_loss}}
						</view>
						<view class="f24 c9c">
							{{$t("vol.tit1")}}
						</view>
					</view>
					<view class="volbox-ib-b1-item bj_sx">
						<view class="f40 fwb cy mb10">
							{{$t("menu.$")}}{{data.today_relief_money}}
						</view>
						<view class="f24 c9c">
							{{$t("vol.tit2")}}
						</view>
					</view>
				</view>

				<view class="bj_between" style="margin-bottom: 80rpx;">
					<view class="volbox-wbtn">
						{{$t("vol.btn1")}}
					</view>
					<view class="volbox-wbtn">
						{{$t("vol.btn2")}}
					</view>
				</view>

				<view class="mb40">
					<view class="volbox-th bj_between f32 tc">
						<view class="w60">
							{{$t("vol.th1")}}
						</view>
						<view class="w40">
							{{$t("vol.th2")}}
						</view>
					</view>
					<view class="volbox-tr bj_between" v-for="item in data.relief_config">
						<view class="w60">
							≥ -{{item.min_loss}} BRL
						</view>
						<view class="w40">
							{{item.money}} BRL
						</view>
					</view>
				</view>

				<view class="f30 fwb mb20">
					{{$t("vol.tit3")}}
				</view>
				<view class="mb50">
					<view class="f22 c9c mb10" v-for="i in 8">
						{{$t("vol.txt" + i)}}
					</view>
				</view>

			</view>
		</view>
		<bottomVue></bottomVue>
	</view>
</template>

<script setup>
	import {
		ref,
		inject,
		provide
	} from 'vue';
	import {
		onShow
	} from "@dcloudio/uni-app"
	import topboxVue from '../common/topbox.vue';
	import useI18n from '@/store/useI18n.js'
	import bottomVue from "../common/bottom-slotsbr.vue";
	import common from '../../js/common';
	const {
		t
	} = useI18n()
	provide("repage", repage);
	// 父级关闭活动的方法
	const clhd = inject("clhd");
	let hdc = ref("hdpagein")
	
	let data = ref({})

	onShow(function() {
		common.reliefInit().then(res => {
			data.value = res.data.data
		})
	})

	function repage() {
		hdc.value = "hdpageout";
		clhd();
	}
</script>

<style scoped lang="scss">
	.volbox {
		position: relative;

		&-th {
			height: 72rpx;
			background: linear-gradient( 90deg, #00561D 0%, #007E2A 100%);
			border-radius: 20rpx 20rpx 0rpx 0rpx;
		}

		&-tr {
			background: #083F1A;
			color: #9C9FB2;
			font-size: 28rpx;
			text-align: center;
			height: 84rpx;
		}

		&-tr:nth-child(even) {
			background: #00561D;
		}

		&-tr:last-child {
			border-radius: 0rpx 0rpx 20rpx 20rpx;
		}

		&-tp {
			position: absolute;
			width: 720rpx;
			height: 384rpx;
			top: 20rpx;
			left: 14rpx;
		}

		&-ib {
			padding: 340rpx 30rpx 0;
			position: relative;
			z-index: 1;

			&-b1 {
				background: #00561D;
				border-radius: 20rpx;
				padding: 26rpx 18rpx;

				&-item {
					width: 316rpx;
					height: 160rpx;
					background: #003311;
					border-radius: 20rpx;
				}
			}
		}

		&-wbtn {
			width: 328rpx;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			font-size: 32rpx;
			font-weight: bold;
			background: #00561D;
			border-radius: 12rpx;
		}
	}
</style>